<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>物业收费管理</title>
    <!-- Tailwind CSS v3 -->
    <script src="https://cdn.tailwindcss.com"></script>
    <!-- Font Awesome -->
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!-- 统一的 Tailwind 配置 -->
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                     primary: '#1e40af',
                     secondary: '#3b82f6',
                     accent: '#60a5fa',
                     light: '#f3f4f6',
                     dark: '#1e293b'
                 },
                 fontFamily: {
                     sans: ['Inter', 'system-ui', 'sans-serif'],
                    }
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .bg-gradient-blue {
                background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .transition-all-300 {
                transition: all 300ms ease-in-out;
            }
            .card {
                @apply bg-white rounded-md shadow-sm border border-gray-100;
            }
            .card-header {
                @apply p-4 border-b border-gray-100 font-medium text-gray-700 flex items-center justify-between;
            }
            .card-body {
                @apply p-4;
            }
            .nav-link {
                @apply flex items-center px-4 py-3 text-gray-600 hover:bg-blue-50 hover:text-blue-600 rounded-md transition-all-300;
            }
            .nav-link.active {
                @apply bg-blue-50 text-blue-600;
            }
            .nav-link i {
                @apply mr-3;
            }
            .btn {
                @apply px-4 py-2 rounded-md font-medium transition-all-300 focus:outline-none focus:ring-2 focus:ring-offset-2;
            }
            .btn-primary {
                @apply bg-blue-600 text-white hover:bg-blue-700 focus:ring-blue-500;
            }
            .btn-outline {
                @apply border border-gray-300 text-gray-700 hover:bg-gray-50 focus:ring-gray-500;
            }
            .btn-sm {
                @apply px-3 py-1 text-sm;
            }
            .badge {
                @apply px-2 py-1 text-xs font-medium rounded-full;
            }
            .badge-success {
                @apply bg-green-100 text-green-800;
            }
            .badge-warning {
                @apply bg-yellow-100 text-yellow-800;
            }
            .badge-danger {
                @apply bg-red-100 text-red-800;
            }
            .badge-info {
                @apply bg-blue-100 text-blue-800;
            }
            .table-row-hover {
                @apply hover:bg-gray-50 transition-all-300;
            }
        }
    </style>
    <style>
        .fee-amount {
            color: #e6a23c;
            font-weight: 500;
        }
        
        .total-fee {
            color: #f56c6c;
            font-weight: 500;
        }
        
        .fee-pending {
            background-color: #fff3cd;
            color: #856404;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
        }
        
        .fee-paid {
            background-color: #d4edda;
            color: #155724;
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
        }
        
        .action-buttons {
            display: flex;
            gap: 8px;
        }
        
        .btn-edit {
            background-color: #FFC107;
            color: #212529;
            border: none;
            padding: 4px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .btn-edit:hover {
            background-color: #ffb300;
        }
        
        .btn-delete {
            background-color: #dc3545;
            color: white;
            border: none;
            padding: 4px 12px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .btn-delete:hover {
            background-color: #c82333;
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen">
    <!-- 修改flex容器样式，确保侧边栏和主内容区域正确排列 -->
    <div class="flex h-screen overflow-hidden">
        <!-- 侧边导航栏 - 使用绝对定位确保它始终可见 -->
        <aside class="w-64 bg-white shadow-sm border-r border-gray-200 flex-shrink-0 z-10 absolute inset-y-0 left-0">
            <!-- Logo -->
            <div class="flex items-center justify-center h-16 border-b border-gray-100">
                <div class="flex items-center">
                    <i class="fa fa-building-o text-blue-600 text-2xl mr-2"></i>
                    <span class="text-lg font-semibold text-gray-800">物业管理系统</span>
                </div>
            </div>
            
            <!-- 导航菜单 -->
            <nav class="p-4 space-y-1">
                <a href="dashboard.html" class="nav-link" data-target="dashboard-section">
                    <i class="fa fa-dashboard"></i>
                    <span>控制面板</span>
                </a>
                <a href="community.html" class="nav-link" data-target="community-section">
                    <i class="fa fa-building"></i>
                    <span>小区管理</span>
                </a>
                <a href="owners.html" class="nav-link" data-target="owners-section">
                    <i class="fa fa-users"></i>
                    <span>业主管理</span>
                </a>
                <a href="users.html" class="nav-link" data-target="users-section">
                    <i class="fa fa-user-circle"></i>
                    <span>用户管理</span>
                </a>
                <a href="maintenance.html" class="nav-link" data-target="maintenance-section">
                    <i class="fa fa-wrench"></i>
                    <span>报修管理</span>
                </a>
                <a href="announcements.html" class="nav-link" data-target="announcements-section">
                    <i class="fa fa-bullhorn"></i>
                    <span>公告管理</span>
                </a>
                <a href="fee_management.html" class="nav-link active" data-target="fee-management-section">
                    <i class="fa fa-credit-card"></i>
                    <span>物业收费管理</span>
                </a>
                <a href="settings.html" class="nav-link" data-target="settings-section">
                    <i class="fa fa-cog"></i>
                    <span>系统设置</span>
                </a>
            </nav>
        </aside>
        
        <!-- 主内容区域 - 添加左侧边距，避免被绝对定位的侧边栏遮挡 -->
        <div class="flex-1 flex flex-col overflow-hidden ml-64">
            <!-- 顶部导航栏 -->
            <header class="bg-white shadow-sm z-10">
                <div class="flex items-center justify-between h-16 px-6">
                    <!-- 移动端菜单按钮 -->
                    <button id="mobile-menu-button" class="md:hidden text-gray-500 hover:text-gray-700 focus:outline-none">
                        <i class="fa fa-bars"></i>
                    </button>
                    
                    <!-- 搜索框 -->
                    <div class="flex-1 max-w-md ml-4 md:ml-8">
                        <div class="relative">
                            <span class="absolute inset-y-0 left-0 flex items-center pl-3">
                                <i class="fa fa-search text-gray-400"></i>
                            </span>
                            <input type="text" placeholder="搜索..." class="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                        </div>
                    </div>
                    
                    <!-- 用户菜单 -->
                    <div class="flex items-center space-x-4">
                        <!-- 通知 -->
                        <button class="relative text-gray-500 hover:text-gray-700 focus:outline-none">
                            <i class="fa fa-bell"></i>
                            <span class="absolute top-0 right-0 h-2 w-2 bg-red-500 rounded-full"></span>
                        </button>
                        
                        <!-- 用户头像 -->
                        <div class="relative">
                            <button id="user-menu-button" class="flex items-center focus:outline-none">
                                <div class="w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white">
                                    <i class="fa fa-user"></i>
                                </div>
                                <span class="ml-2 text-sm font-medium text-gray-700 hidden md:block">管理员</span>
                                <i class="fa fa-chevron-down ml-1 text-xs text-gray-400 hidden md:block"></i>
                            </button>
                            
                            <!-- 用户下拉菜单 -->
                            <div id="user-menu" class="absolute right-0 mt-2 w-48 bg-white rounded-md shadow-lg py-1 z-20 hidden">
                                <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">个人资料</a>
                                <a href="#" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">设置</a>
                                <div class="border-t border-gray-100"></div>
                                <a href="login.html" class="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100">退出登录</a>
                            </div>
                        </div>
                    </div>
                </div>
            </header>
            
            <!-- 移动端侧边栏 -->
            <div id="mobile-sidebar" class="fixed inset-0 z-40 hidden">
                <div class="fixed inset-0 bg-gray-600 bg-opacity-75"></div>
                <div class="relative flex-1 flex flex-col max-w-xs w-full bg-white">
                    <div class="absolute top-0 right-0 -mr-12 pt-2">
                        <button id="close-sidebar-button" class="ml-1 flex items-center justify-center h-10 w-10 rounded-full focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white">
                            <i class="fa fa-times text-white"></i>
                        </button>
                    </div>
                    <div class="flex-1 h-0 pt-5 pb-4 overflow-y-auto">
                        <div class="flex-shrink-0 flex items-center justify-center">
                            <i class="fa fa-building-o text-blue-600 text-3xl"></i>
                        </div>
                        <nav class="mt-5 px-2 space-y-1">
                            <a href="dashboard.html" class="nav-link" data-target="dashboard-section">
                                <i class="fa fa-dashboard"></i>
                                <span>控制面板</span>
                            </a>
                            <a href="community.html" class="nav-link" data-target="community-section">
                                <i class="fa fa-building"></i>
                                <span>小区管理</span>
                            </a>
                            <a href="owners.html" class="nav-link" data-target="owners-section">
                                <i class="fa fa-users"></i>
                                <span>业主管理</span>
                            </a>
                            <a href="users.html" class="nav-link" data-target="users-section">
                                <i class="fa fa-user-circle"></i>
                                <span>用户管理</span>
                            </a>
                            <a href="maintenance.html" class="nav-link" data-target="maintenance-section">
                                <i class="fa fa-wrench"></i>
                                <span>报修管理</span>
                            </a>
                            <a href="announcements.html" class="nav-link" data-target="announcements-section">
                                <i class="fa fa-bullhorn"></i>
                                <span>公告管理</span>
                            </a>
                            <a href="fee_management.html" class="nav-link active" data-target="fee-management-section">
                                <i class="fa fa-credit-card"></i>
                                <span>物业收费管理</span>
                            </a>
                            <a href="settings.html" class="nav-link" data-target="settings-section">
                                <i class="fa fa-cog"></i>
                                <span>系统设置</span>
                            </a>
                        </nav>
                    </div>
                </div>
            </div>
            
            <!-- 页面内容 -->
            <main class="flex-1 overflow-y-auto p-6 bg-gray-50">
                <!-- 物业收费管理 -->
                <section id="fee-management-section" class="space-y-6">
                    <div class="flex items-center justify-between">
                        <h1 class="text-2xl font-bold text-gray-800">物业收费管理</h1>
                        <button id="addFeeButton" class="btn btn-primary">
                            <i class="fa fa-plus mr-2"></i>
                            新增收费
                        </button>
                    </div>
                    
                    <!-- 筛选功能 -->
                    <div class="card">
                        <div class="card-body">
                            <div class="flex flex-wrap items-center gap-4">
                                <div class="flex items-center">
                                    <label class="mr-2 font-medium text-gray-700">居民</label>
                                    <select id="residentSelect" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                                        <option value="">请选择居民</option>
                                        <option value="1">张三</option>
                                        <option value="2">王五</option>
                                        <option value="3">李四</option>
                                        <option value="4">赵六</option>
                                    </select>
                                </div>
                                
                                <div class="flex items-center">
                                    <label class="mr-2 font-medium text-gray-700">缴费状态</label>
                                    <select id="statusSelect" class="border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent">
                                        <option value="">请选择缴费状态</option>
                                        <option value="pending">待缴费</option>
                                        <option value="paid">已缴费</option>
                                    </select>
                                </div>
                                
                                <button id="queryButton" class="btn btn-primary">
                                    <i class="fa fa-search mr-2"></i>
                                    查询
                                </button>
                            </div>
                        </div>
                    </div>
                    
                    <!-- 数据表格 -->
                    <div class="card">
                        <div class="card-header">
                            <h3>费用记录列表</h3>
                        </div>
                        <div class="overflow-x-auto">
                            <table class="min-w-full divide-y divide-gray-200">
                                <thead class="bg-gray-50">
                                    <tr>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">居民</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">电话</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">物业费</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">水费</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">电费</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">垃圾费</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">总费用</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">缴费状态</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">缴费时间</th>
                                        <th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">操作</th>
                                    </tr>
                                </thead>
                                <tbody class="bg-white divide-y divide-gray-200">
                                    <!-- 空数据行示例 -->
                                    <tr class="table-row-hover">
                                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
                                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
                                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span class="fee-amount">-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span class="fee-amount">-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span class="fee-amount">-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span class="fee-amount">-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span class="total-fee">-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap">
                                            <span>-</span>
                                        </td>
                                        <td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">-</td>
                                        <td class="px-6 py-4 whitespace-nowrap text-sm font-medium">
                                            <div class="action-buttons">
                                                <button class="btn-edit">编辑</button>
                                                <button class="btn-delete">删除</button>
                                            </div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    
                    <!-- 分页 -->
                    <div class="flex justify-center items-center gap-4">
                        <button id="prevPage" disabled class="btn btn-outline">
                            上一页
                        </button>
                        <span class="text-gray-600">第 1 页，共 1 页</span>
                        <button id="nextPage" disabled class="btn btn-outline">
                            下一页
                        </button>
                    </div>
                </section>
            </main>
        </div>
    </div>
    
    <!-- JavaScript交互功能 -->
    <script>
        // 初始化页面加载
        window.addEventListener('load', function() {
            console.log('物业收费管理页面已加载');
            
            // 移动端菜单交互
            const mobileMenuButton = document.getElementById('mobile-menu-button');
            const closeSidebarButton = document.getElementById('close-sidebar-button');
            const mobileSidebar = document.getElementById('mobile-sidebar');
            
            if (mobileMenuButton && closeSidebarButton && mobileSidebar) {
                mobileMenuButton.addEventListener('click', function() {
                    mobileSidebar.classList.remove('hidden');
                });
                
                closeSidebarButton.addEventListener('click', function() {
                    mobileSidebar.classList.add('hidden');
                });
                
                // 点击遮罩层关闭侧边栏
                mobileSidebar.addEventListener('click', function(e) {
                    if (e.target === mobileSidebar) {
                        mobileSidebar.classList.add('hidden');
                    }
                });
            }
            
            // 用户菜单交互
            const userMenuButton = document.getElementById('user-menu-button');
            const userMenu = document.getElementById('user-menu');
            
            if (userMenuButton && userMenu) {
                userMenuButton.addEventListener('click', function() {
                    userMenu.classList.toggle('hidden');
                });
                
                // 点击页面其他地方关闭用户菜单
                document.addEventListener('click', function(e) {
                    if (!userMenuButton.contains(e.target) && !userMenu.contains(e.target)) {
                        userMenu.classList.add('hidden');
                    }
                });
            }
            
            // 筛选功能
            const searchButton = document.getElementById('queryButton');
            if (searchButton) {
                searchButton.addEventListener('click', function() {
                    const resident = document.getElementById('residentSelect').value;
                    const status = document.getElementById('statusSelect').value;
                    console.log('筛选条件:', resident, status);
                    alert('筛选功能已触发\n居民: ' + resident + '\n状态: ' + status);
                });
            }
            
            // 新增收费功能
            const addFeeButton = document.getElementById('addFeeButton');
            if (addFeeButton) {
                addFeeButton.addEventListener('click', function() {
                    alert('新增收费功能已触发');
                    // 这里可以添加弹窗表单逻辑
                });
            }
            
            // 编辑按钮事件处理
            const editButton = document.querySelector('.btn-edit');
            if (editButton) {
                editButton.addEventListener('click', function() {
                    alert('编辑费用记录');
                });
            }
            
            // 删除按钮事件处理
            const deleteButton = document.querySelector('.btn-delete');
            if (deleteButton) {
                deleteButton.addEventListener('click', function() {
                    if (confirm('确认删除费用记录吗?')) {
                        alert('删除成功');
                    }
                });
            }
            
            // 分页按钮事件
            const prevPageButton = document.getElementById('prevPage');
            const nextPageButton = document.getElementById('nextPage');
            
            if (prevPageButton) {
                prevPageButton.addEventListener('click', function() {
                    alert('上一页功能');
                });
            }
            
            if (nextPageButton) {
                nextPageButton.addEventListener('click', function() {
                    alert('下一页功能');
                });
            }
        });
    </script>
</body>
</html>